function LiftEffect(json){

var array=[];

for(var i =0; i<json.target.length;i++){
	var t = $(json.target[i]).offset().top;
	array.push(t);

}

function Selected(index){
	$(json.control2).children().eq(index).addClass(json.current).siblings().removeClass(json.current);
}


$(window).on("scroll",Check);

function Check(){

	var wst = $(window).scrollTop();

	
	if(wst >= $(json.target[0]).offset().top-100){
		$(json.control1).fadeIn(500);
	}else{
		$(json.control1).fadeOut(500);
	}

	var key =0;
	var flag = true;
	for(var i =0; i<array.length; i++){
		key++;
		if(flag){

			if(wst >= array[array.length-key]-300){
				var index = array.length-key;
				flag = false;
			}else{
				flag=true;
			}
			
		}
	}
	Selected(index);
}

$(json.control2).children().on("click",function(){

		$(window).off("scroll");
		var index = $(this).index();
		Selected(index);

		
		var flag = true;
		for(var i =0; i<array.length; i++){
		
			if(flag){
	
				if(index == i){
					$("html,body").stop().animate({
						"scrollTop": array[i]-50
					},500,function(){
						$(window).on("scroll",Check);
					});
					flag = false;
				}else{
					flag=true;
				}
				
			}
		}
		
});
}
var maxtime = 60 * 4323;

			function CountDown() {
				if(maxtime >= 0) {
					haomiao = Math.floor(maxtime/1000);
					minutes = Math.floor(maxtime / 60 % 60);
					seconds = Math.floor(maxtime % 60);
					fen = Math.floor(maxtime / 60 % 24);
					tian = Math.floor(maxtime / 60 / 60 / 24)
//					msg = "距离结束还有" + tian + "天" + fen + "小时" + minutes + "分" + seconds + "秒" + haomiao + "毫秒";
					document.getElementById("me1").innerHTML=tian;
					document.getElementById("me2").innerHTML=tian;
					document.getElementById("me3").innerHTML=tian;
					document.getElementById("me4").innerHTML=tian;
					document.getElementById("me5").innerHTML=tian;
					document.getElementById("me6").innerHTML=tian;
					document.getElementById("me7").innerHTML=tian;
					document.getElementById("me8").innerHTML=tian;
					
//					document.all["timer"].innerHTML = 'msg';
					if(maxtime == 5 * 60) alert("还剩5分钟");
					--maxtime;
				} else {
					clearInterval(timer);
					alert("时间到，结束!");
				}
			}
			timer = setInterval("CountDown()", 1000);